package com.liangwj.springbootdesignpatterns.structureTypePatterns.decorator.demo_2;
/**
 * <b>Description:</b> 浓缩咖啡 <br/>
 * @author Lingwenjun
 * @date 2019/1/29-15:08
 * @version 1.0
 */
public class Espresso extends Beverage{

    //为了要设置饮料的描述，我们写了一个构造器，description实例变量继承自Beverage
    public Espresso() {
        description = "Espresso";
    }

    //计算价格
    @Override
    public double cost() {
        return 1.99;
    }
}

class HouseBlend extends Beverage{

    //为了要设置饮料的描述，我们写了一个构造器，description实例变量继承自Beverage
    public HouseBlend() {
        description = "HouseBlend";
    }

    //计算价格
    @Override
    public double cost() {
        return 0.89;
    }
}

class DarkRoast extends Beverage{

    //为了要设置饮料的描述，我们写了一个构造器，description实例变量继承自Beverage
    public DarkRoast() {
        description = "Espresso";
    }

    //计算价格
    @Override
    public double cost() {
        return 0.99;
    }
}

class Decaf extends Beverage{

    //为了要设置饮料的描述，我们写了一个构造器，description实例变量继承自Beverage
    public Decaf() {
        description = "Decaf";
    }

    //计算价格
    @Override
    public double cost() {
        return 1.05;
    }
}
